import config from "@/config"
import http from "@/utils/request"

export default {
	upload: {
		uploadImage: {
			method: `common.common.uploadImage`,
			name: "上传图片",
			post: async function (data = {}) {
				return await http.post(this.method, data);
			}
		},
		uploadFile: {
			method: `common.common.uploadFile`,
			name: "文件",
			post: async function (data = {}) {
				return await http.post(this.method, data);
			}
		},
		file: {
			menu: {
				url: `${config.API_URL}/file/menu`,
				name: "获取文件分类",
				get: async function () {
					return await http.get(this.url);
				}
			},
			list: {
				url: `${config.API_URL}/file/list`,
				name: "获取文件列表",
				get: async function (params) {
					return await http.get(this.url, params);
				}
			}
		}
	},
	export: {
		list: {
			method: `common.exportFile.index`,
			name: "展示列表",
			get: async function (data = {}) {
				return await http.post(this.method, data);
			}
		},
		show: {
			method: `common.exportFile.show`,
			name: "展示",
			get: async function (data = {}) {
				return await http.post(this.method, data);
			}
		},
		export: {
			method: `common.exportFile.export`,
			name: "导出",
			post: async function (data = {}) {
				return await http.post(this.method, data);
			}
		},
		download: {
			method: `common.exportFile.download`,
			name: "下载",
			post: async function (data = {}) {
				return await http.post(this.method, data);
			}
		}
	},
	getImportTemplate: {
		method: `common.common.getImportTemplate`,
		name: "下载导入模板",
		get: async function (data = {}) {
			return await http.post(this.method, data);
		}
	},
	ossSts: {
		method: `common.common.ossSts`,
		name: "获取oss token",
		post: async function (data = {}) {
			return await http.post(this.method, data);
		},
	}

}
